import routeComponentName from '@/config/route-component-name'

const commodiRouter = [
  {
    path: '/commodity',
    component: () => import('@/layout/index.vue'),
    name: 'commodity',
    meta: { title: '物料列表', icon: 'Present', keepAlive: true },
    redirect: '/commodity/commodi',
    children: [
      {
        path: 'commodi',
        component: () => import('@/views/commodity/index.vue'),
        name: 'commodi',
        meta: {
          title: '物料列表',
          icon: 'Present',
          keepAlive: true,
          componentName: routeComponentName.good.goodList,
        },
      },
      {
        path: '/commodity/add',
        component: () => import('@/views/commodity/addgoods/index.vue'),
        name: 'commodity1',
        meta: {
          title: '新增物料',
          keepAlive: true,
          componentName: routeComponentName.good.goodForm,
        },
        hidden: true,
      },
      {
        path: '/commodity/commodi/edit/:id',
        component: () => import('@/views/commodity/addgoods/index.vue'),
        name: 'editCommodity',
        meta: {
          title: '修改成品',
          keepAlive: true,
          componentName: routeComponentName.good.goodForm,
        },
        hidden: true,
      },
      {
        path: '/commodity/commodi/editSpare/:id',
        component: () => import('@/views/commodity/addgoods/index.vue'),
        name: 'editCommodity2',
        meta: {
          title: '修改物料',
          keepAlive: true,
          componentName: routeComponentName.good.goodForm,
        },
        hidden: true,
      },
      {
        path: '/commodity/commodi/detail/:id',
        component: () => import('@/views/commodity/addgoods/detail/index.vue'),
        name: 'detail',
        meta: {
          title: '物料详情',
          keepAlive: true,
          componentName: routeComponentName.good.goodDetail,
        },
        hidden: true,
      },
      // 品牌
      // {
      //   path: '/commodity/brand',
      //   component: () => import('@/views/commodity/brand/index.vue'),
      //   name: 'brand',
      //   meta: {
      //     title: '品牌管理',
      //     keepAlive: true,
      //   },
      // },
      {
        path: '/busic/base/proset',
        component: () => import('@/views/busic/base/module/good-set/index.vue'),
        name: 'proSet',
        meta: {
          title: '物料设置',
          keepAlive: true,
          componentName: routeComponentName.setting.goodSet,
        },
      },
      {
        path: '/commodity/addbrand',
        component: () => import('@/views/commodity/brand/add/index.vue'),
        name: 'addBrand',
        meta: {
          title: '添加品牌',
          keepAlive: true,
          componentName: routeComponentName.good.brandForm,
        },
        hidden: true,
      },
      {
        path: '/commodity/editbrand/:id',
        component: () => import('@/views/commodity/brand/add/index.vue'),
        name: 'editBrand',
        meta: {
          title: '修改品牌',
          keepAlive: true,
          componentName: routeComponentName.good.brandForm,
        },
        hidden: true,
      },
      {
        path: '/commodity/branddetail/:id',
        component: () => import('@/views/commodity/brand/detail/index.vue'),
        name: 'brandDetail',
        meta: {
          title: '品牌详细',
          keepAlive: true,
          componentName: routeComponentName.good.brandDetail,
        },
        hidden: true,
      },
      {
        path: '/commodity/branddetail/:id',
        component: () => import('@/views/commodity/brand/detail/index.vue'),
        name: 'brandDetail',
        meta: {
          title: '品牌详细',
          keepAlive: true,
          componentName: routeComponentName.good.brandDetail,
        },
        hidden: true,
      },
      {
        path: 'goodsExcelImport',
        component: () => import('@/views/excel/index.vue'),
        name: 'goodsExcelImport',
        meta: {
          title: '物料资料导入',
          keepAlive: true,
          componentName: routeComponentName.common.import,
        },
        hidden: true,
      },
      {
        path: 'warranty/policy/list',
        component: () => import('@/views/commodity/warranty-policy/create/index.vue'),
        name: 'warrantyPolicyCreate',
        meta: {
          title: '添加保修政策',
          keepAlive: true,
          componentName: routeComponentName.good.warrantyPolictForm,
        },
        hidden: true,
      },
      {
        path: 'warranty/policy/update/:id',
        component: () => import('@/views/commodity/warranty-policy/create/index.vue'),
        name: 'warrantyPolicyUpdate',
        meta: {
          title: '编辑保修政策',
          keepAlive: true,
          componentName: routeComponentName.good.warrantyPolictForm,
        },
        hidden: true,
      },
      {
        path: 'goodBomImport',
        component: () => import('@/views/excel/index.vue'),
        name: 'goodBomImport',
        meta: {
          title: '物料BOM导入',
          keepAlive: true,
          componentName: routeComponentName.common.import,
        },
        hidden: true,
      },
    ],
  },
]

export default commodiRouter
